cmake_minimum_required(VERSION 3.0.0)
message("opcua...")
project(opcua_plugin)
set(CMAKE_CXX_STANDARD 14)


#set WA_SDK_DIR paths
if(NOT DEFINED WA_SDK_DIR)
  set (WA_SDK_DIR  ../wa-iot-edge-sdk/wa-iot-sdk/host)
endif()

include(${WA_SDK_DIR}/wa-sdk.cmake)
include (${WA_SDK_DIR}/rules.cmake)

add_definitions(-DLOG_MY_MASK_ID=7)

if(NOT DEFINED PLATFORM)
    set(PLATFORM x86)
endif()

# Tell the loader to look up the dependent dynamic libraries from the same folder.
set(CMAKE_INSTALL_RPATH "$ORIGIN")
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)


# 包含头文件
include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}/deps
    ${CMAKE_CURRENT_SOURCE_DIR}/inc
)

# 包含源文件
set(OPCUA_SOURCE
    "src/opcua_entries.cpp"
    "src/opcua_resource.cpp"

    ${CMAKE_CURRENT_SOURCE_DIR}/deps/open62541.c
)

# 包含动态库
add_library(opcua_plugin SHARED ${OPCUA_SOURCE})

linkWA_SDK(opcua_plugin)

